<template>

	<body>
		<div class="loan_nav col_nav">
			<ul>
				<li>
					<a href="javascript:history.go(-1)">
						<i class="iconfont">&#xe61e;</i>
					</a>
				</li>
				<li>
					<p>修改手机号</p>
				</li>
				<li></li>
			</ul>
		</div>
		<div class="interval_T">

		</div>
		<div class="register_form">
			<!-- <ul>
				
			</ul> -->
			<ul>
				<li>
					<p>手机号码</p>
				</li>
				<li><input v-model="params.mobile" type="text" placeholder="中国大陆手机号" maxlength="11" /></li>
				<li></li>
			</ul>
			<ul>
				<li>
					<p>验证码</p>
				</li>
				<li><input v-model="params.randCode" type="text" placeholder="请输入短信验证码" maxlength="6" /></li>
				<li><input @click="sendSms" type="button" value="发送验证码" class="col-db" /></li>
			</ul>
			<ul>
				<li>
					<p>登入密码</p>
				</li>
				<li><input v-model="params.password" type="text" placeholder="请输入登入密码" /></li>
				<li></li>
			</ul>
		</div>
		<div class="btn">
			<input @click="change" type="button" value="验证后绑定新手机号" class="col-green" />
		</div>
		<div class="tip_binding">
			<p>若当前号码已不用或丢失，请选用
				<router-link class="col_b" to="feedbackfeedback">在线申诉</router-link>
			</p>
		</div>
	</body>
</template>

<script>
export default {
	data() {
		return {
			params: {
				codeType: 'updatepwd',
				randType: 'updatepwd'
			}
		}
	},
	methods: {
		sendSms() {
			this.$http.post('/app/randCode', this.params).then(json => {
				const { code, msg } = json
				if (code === 0) {
					this.$vux.toast.show({ text: msg })
				}
			})
		},
		change() {
			this.$http.post('/app/member/changeMobile', this.params).then(json => {
				const { code, msg } = json
				if (code === 0) {
					this.$vux.toast.show({ text: msg })
					this.$router.go(-1)
				}
			})
		}
	}
}
</script>

<style>

</style>